
/**
 * @version			$Id$
 * @create 			2012-8-20 15:32:53 By xjiujiu
 * @package 		render
 * @copyRight 		Copyright (c) 2011-2012 http://www.xjiujiu.com.All right reserved
 * HongJuZi Framework
 */

 /**
  * 对第三方JS效果插件的绑定 
  * 
  * 如：editor、lightbox、uploadify等 
  * 
  * @author 	xjiujiu <xjiujiu@foxmail.com>
  * @package 	None
  * @since 	    1.0.0
  */
(function($) {
	var HHBindRender 	= {

        /**
         * 绑定Ajax上传插件：Uploadify 
         * 
         * 用法：
         * <code>
         * //html代码
         * <div id="uploadify_id"></div>
         * //js 代码
         *  HHJsLib.bindUploadify("#uploadify_id");
         * </code>
         * 
         * @author 			xjiujiu <xjiujiu@foxmail.com>
         * @access public
         * @param  String target DOM目标ID
         * @return void
         * @throws none
         */
        bindUploadify: function(target) {
			$(target).uploadify({
				'auto': 		true,
				'height': 		30,
				'width': 		120,
				'multi': 		true,
				'buttonText': 	"浏览",
				'buttonImage': 	siteUrl + "/public/template/render/uploader/uploadify/browse-btn.png",
				'swf': 			siteUrl + "/public/template/render/uploader/uploadify/uploadify.swf",
				'uploader': 	siteUrl + "/index.jsp/admin/user/uploadimage"
			});
		},
        /**
         * 绑定lightBox
         * 
         * 用法：
         * <code>
         * //HTML代码
         * <a href="http://xxx.xxx.xx/images/xxx.jgp" class="lightbox other-class">other demo</a>
         * //JS代码
         * HHJsLib.bindLightBox("a.lightbox");
         * </code>
         * 
         * @author 			xjiujiu <xjiujiu@foxmail.com>
         * @access public
         * @param  String target 目标DOM
         * @return void
         * @throws none
         */
	    bindLightBox: function(target){
	        $(target).lightBox({
	            overlayBgColor: '#ccc',
	            overlayOpacity: 0.6,
	            imageLoading: siteUrl + '/public/template/render/lightbox/lightbox-ico-loading.gif',
	            imageBtnClose: siteUrl + '/public/template/render/lightbox/lightbox-btn-close.gif',
	            imageBtnPrev: siteUrl + '/public/template/render/lightbox/lightbox-btn-prev.gif',
	            imageBtnNext: siteUrl + '/public/template/render/lightbox/lightbox-btn-next.gif',
	            imageBlank: siteUrl + '/public/template/render/lightbox/lightbox-blank.gif',
	            containerResizeSpeed: 350,
	            txtImage: 'Imagem',
	            txtOf: 'de'
	        });
	    }
	};
    //扩展到HHJsLib库中
	HHJsLib.extend(HHBindRender);
})(jQuery);
